import 'package:flutter/material.dart';

class DDSearchField extends StatefulWidget {
  final String hintText;

  DDSearchField(this.hintText);

  @override
  State<StatefulWidget> createState() => new DDSearchFieldState();
}

class DDSearchFieldState extends State<DDSearchField> {
  @override
  Widget build(BuildContext context) {
    return new Container(
      margin: new EdgeInsets.only(left: 10.0),
      padding: new EdgeInsets.only(left: 10.0),
      height: 30.0,
      width: 250.0,
      decoration: new BoxDecoration(
        color: Color(0xFFEEEEEE),
        borderRadius: BorderRadius.all(
          Radius.circular(58.0),
        ),
      ),
      child: new Row(
        children: <Widget>[
          new Icon(
            Icons.search,
            size: 20.0,
            color: Colors.black54,
          ),
          new Container(
            width: 180.0,
            height: 43.0,
            child: new Container(
              padding: new EdgeInsets.only(left: 10.0),
              child: new Center(
                child: new Form(
                  autovalidate: false,
                  child: new TextFormField(
                    style: new TextStyle(color: Colors.teal),
                    textAlign: TextAlign.start,
                    decoration: new InputDecoration.collapsed(
                      fillColor: Colors.white,
                      filled: false,
                      hintText: widget.hintText,
                      hintStyle: new TextStyle(
                        fontSize: 13.0,
                        color: Colors.black45,
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
